package com.xce.order.feign;

import com.xce.order.feign.fallback.ProductFeignClientFallback;
import com.xce.product.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @ClassName ProductFeignClient
 * @Description TODO
 * @Author lld
 * @Date 2025/6/29 20:20
 * @Version 1.0
 */
@FeignClient(value = "gateway", contextId = "product",
        fallback = ProductFeignClientFallback.class)  // 调用方的应用名
public interface ProductFeignClient {

    @GetMapping("/api/product/getProduct/{productId}")
    Product getProductById(@PathVariable("productId") Long productId);
}
